<?php
    /**
     * Created by PhpStorm.
     * User: huangzhongwei
     * Date: 2018/11/5
     * Time: 19:19
     */

    namespace app\common\model;


    use think\Model;

    class Withdrawal extends Model
    {
        protected $table = "withdrawal";
        protected $autoWriteTimestamp = true;

        public static function getRecordList($uid, $page = 1, $size = 20)
        {
            $result = self::where( 'account_id' , $uid)
                          ->order('create_time', 'desc')
                          ->paginate($size, true, ['page' => $page]);
            return $result;
        }

        public function account(){
            return $this->belongsTo('Account','account_id');
        }


    }